-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
chore: emit await_reactivity_loss
in for await
loops
#16521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: 88ba8e4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clever solution, I like this much more than convoluted code transformations. I guess we need to decide whether we separately want to handle for await
at the top level of components. Seems like a footgun but maybe there's a case where it would be useful? At the moment it won't compile (which is better than compiling but with broken reactivity)
Currently,
await
expressions not inside an async derived are wrapped intrack_reactivity_loss
in dev to warn of a reactivity loss.However,
for await
loops are not. This PR fixes that.Before submitting the PR, please make sure you do the following
feat:
,fix:
,chore:
, ordocs:
.packages/svelte/src
, add a changeset (npx changeset
).Tests and linting
pnpm test
and lint the project withpnpm lint